This directory contains some software to make buoy collocations with scatterometer data.
Several steps are necessary to make the collocations.

1) Retrieve buoy data from the MARS archive

The MARS archive at ECMWF contains buoy data that are distributed over the GTS in BUFR.
The script get_buoy_data_from_mars.ksh retrieves them from the MARS and writes the data
to an ASCII file. For this step it is necessary to put genscat on the ECGATE server and
compile it. Moreover, you need a list of blacklisted buoys that is valid in the month
for which you want to retrieve data. Blacklists can be obtained from Jean Bidlot
(jean.bidlot@ecmwf.int), he produces them within a few weeks after a certain month has
ended. The blacklists have file names like blacklist_YYYYMM and blacklist2_YYYYMM

Run

(path)/get_buoy_data_from_mars.ksh <start date> <end date> <directory containing blacklists>

with dates in the format YYYYMMDD on ECGATE to retrieve the data. Normally you retrieve one
month of data at a time, e.g. 20080101 to 20080131. The script invokes the BuoyRead program
and writes buoy wind data (real winds and winds converted to 10m neutral winds) together
with some metadata (buoy position, sensor heights etc.) to ASCII files called
buoy_data_YYYYMMDD. All ASCII files spanning the whole period are collected in one tar
file that is created in your ${SCRATCH} directory on ECGATE. To finalise this step, transfer
the tar file to your local workstation using ectrans.

2) Collocate the buoy data with the scatterometer data

The buoy data can be collocated with the scatterometer BUFR data (in SeaWinds or ASCAT
format) using the BuoyCollocate program. This program is called using:

(path)/BuoyCollocate -f <BUFR input file> -o <ASCII output file> -b <buoy data file>

where the buoy data file is a file buoy_data_YYYYMMDD as obtained in step 1). The
scatterometer BUFR file can be a concatenation of all scatterometer files of one day.
The output file contains all collocations in ASCII format. From the scatterometer data,
both the selected wind and the model wind are written to the output file. If the
scatterometer data were processed with the -research option set, the output file also
contains the 2DVAR analysis speed and direction as last two items on a line.

3) Make binned file containing the collocations

The output files from the previous step can be converted to a binned file containing
histograms of u, v, wind speed and wind direction using the program BuoyColl2Bin. First,
concatenate all collocated files of one month to one new file. Then call BuoyColl2Bin:

(path)/BuoyColl2Bin -f <ASCII input file> -o <ASCII output file> [-model]

The output file contains the binned data. With the -model command line option, you extract
the model winds from the collocation files instead of the selected scatterometer winds.

4) Plot the binned data using IDL

The script genscat/plotting/idl/binning/run_2Dbinned_plots can be called with as parameters
the file containing binned data and a short describing footer text line in quotes (' ').
It will make nice histograms containing some statistics and write them to a file called result.ps.
